package com.lysj.admin.master.bussiness.company.recharge.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lysj.admin.master.bussiness.company.CompanyEntity;
import com.lysj.admin.master.common.enumeration.EnumInterface;
import com.lysj.admin.master.common.spring.mpbase.MyEntity;
import com.lysj.admin.master.common.validation.annotation.Min;
import com.lysj.admin.master.common.validation.annotation.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author Created by drj on 2019-12-23 14:54
 * @description 充值记录
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@TableName("lysj_company_recharge_record")
@Table(name = "lysj_company_recharge_record", indexes = {
        @Index(name = "idx_company_id", columnList = "companyId")})
public class RechargeRecord extends CompanyEntity {


    @Getter
    public enum RechargeStatus implements EnumInterface {
        AUDITING(1, "待审核"),
        RECHARGED(2, "已充值"),
        REJECTED(3, "驳回");

        private Integer code;
        private String status;

        RechargeStatus(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    @NotBlank(message = "服务商不能为空")
    private String serviceProviderId;//服务商id
    private String serviceProviderName;//服务商名称
    @Column(columnDefinition = "decimal(10,2)")
    @Min(value = "0", message = "充值金额必须大于0")
    private BigDecimal rechargePrice;//充值金额
    private String transferPhoto;//转账凭证
    private String remark;//备注
    private Integer rechargeStatus;//充值状态（默认待审核）
    private transient String rechargeStatusTxt;//充值状态
}
